<template>
  <div
    class="header"
    :style="{
      backgroundImage: `url(${sellerIofo.avatar})`,
    }"
  >
    <!-- 毛玻璃遮罩层 -->
    <div class="mask"></div>
    <!-- 商家头部信息 -->
    <div class="info">
      <!-- 头部图片 -->
      <div class="pic">
        <img :src="sellerIofo.avatar" alt="商家logo" />
      </div>
      <!-- 右边内容部分 -->
      <div class="title">
        <p class="p1">{{ sellerIofo.name }}</p>
        <p class="p2">{{ sellerIofo.description }} / 38分钟送达</p>

        <p class="p3">在线支付满28减5，满50减10</p>
        <p class="p4">5个&nbsp;&nbsp;&gt;</p>
      </div>
    </div>
    <div class="tips">
      <p>
        {{ sellerIofo.bulletin }}
      </p>
    </div>
  </div>
</template>

<script>
import { mapActions, mapState } from "vuex";
export default {
  data() {
    return {};
  },
  created() {
    //获取头部数据
    this.getSeller();
  },
  computed: {
    ...mapState(["sellerIofo"]),
  },
  methods: {
    ...mapActions(["getSeller"]),
  },
};
</script>

<style lang="less" scoped>
.header {
  height: 134px;
  background: #333;
  overflow: hidden;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
  .mask {
    position: absolute;
    width: 100%;
    left: 0;
    top: 0;
    height: 100%;
    background-color: rgba(7, 17, 27, 0.5);
    // 毛玻璃效果设置
    backdrop-filter: blur(10px);
  }
  .info {
    position: absolute;
    width: 100%;
    left: 0;
    top: 0;
    height: 100%;
    display: flex;
    padding: 24px 0px 0px 24px;
    .pic {
      margin-right: 16px;
      img {
        width: 64px;
      }
    }
    .title {
      .p1 {
        font-size: 16px;
        color: #fff;
        font-weight: bold;
        line-height: 18px;
        &::before {
          content: "品牌";
          margin-right: 6px;
          background-color: red;
          padding: 2px 6px;
        }
      }
      .p2 {
        font-size: 12px;
        color: #fff;
        font-weight: 200;
        line-height: 12px;
        margin: 8px 0px 10px 0px;
      }
      .p3 {
        font-size: 10px;
        font-weight: 200;
        color: #fff;
        line-height: 12px;
        &::before {
          content: "减";
          margin-right: 4px;
          color: red;
          background-color: #fff;
          padding: 0px 4px;
        }
      }
      .p4 {
        position: absolute;
        right: 10px;
        bottom: 68px;
        padding: 14px;
        border-radius: 20px;
        font-size: 10px;
        color: #fff;
        font-weight: 200;
        line-height: 12px;
        background-color: rgba(7, 17, 27, 0.2);
      }
    }
    position: relative;
  }
  .tips {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    font-size: 10px;
    color: #fff;
    padding-left: 12px;
    background: rgba(7, 17, 27, 0.2);

    p {
      height: 28px;
      line-height: 28px;
      width: 98%;
      text-overflow: ellipsis;
      white-space: nowrap;
      overflow: hidden;
      font-size: 10px;
      font-weight: 200;
      line-height: 28px;
      &::before {
        content: "公告";
        margin-right: 4px;
        color: black;
        background-color: #fff;
        padding: 0px 4px;
        font-weight: bold;
      }
    }
  }
}
</style>
